import $ from 'jquery'


export default function () {
  let domObj = {} //图片对象
  return {
    /**
     * 设置图片展示框的宽高
     * str是根据传过来的class找到对应的div
     * domStr 是要被设置的框（div）
     */
    setShowImgSize: function (elClassName, elClassName2) {
      if (elClassName) {
        let $el = $(`.${elClassName}`)
        let picBoxWidth = $el.width()
        let picBoxHeight = $el.height()
        $(`.${elClassName2}`).css({
          width: `${picBoxWidth}px`,
          height: `${picBoxHeight}px`
        })
        domObj.width = picBoxWidth
        domObj.height = picBoxHeight
        $('.shwoImgBox').removeClass('boxBorderNoe')
        $el.addClass('boxBorderNoe')
      }
    },
    /**
     * 获取编辑框的宽高
     * 返回dome对象
     * width，height
     */
    getEditFrameSize: function () {
      return domObj
    }

  }
}

